<%@ page pageEncoding="UTF-8"%>

<!-- 顶部导航条  -->
<%@include file="/views/global/header.jsp"%>
<!-- 顶部导航条结束  -->


<!-- logo  -->
<a href="/default"><div class="logo contentWidth center"></div></a>
<!-- logo结束  -->


<!-- navigation和全局搜索  -->
<div class="navigationAndSearch font content">
	<div class="collapse navbar-collapse">
		<ul class="dropmenu">
			<!--品类一览  -->
			<li><a href="item/list" class="searchBarLi">CATEGORY<br />所&nbsp;有&nbsp;商&nbsp;品
			</a>
				<ul>
					<c:forEach var="item" varStatus="status" items="${firstLevelCategoryList }">
						<c:choose>
							<c:when test="${(status.index+1)%2==0 }">
								<div class="sub_menu" kkkkkkkk="${(status.index+1) }">
									<p>
										<a href="javascript:void(0)" class="sub_menutitle" 
											onclick="doSearch(this, 'categoryIdPath', '${item.fullIdPath}')">
											<font class="sub_menutitle_font">${item.name }</font>
										</a>
									</p>
									<c:if test="${not empty item.childCategoryList }">
										<div class="sub_menu_left">
											<c:forEach var="second" items="${item.childCategoryList }">
												<p>
													<a href="javascript:void(0)" class="sub_menutext"
														onclick="doSearch(this, 'categoryIdPath', '${second.fullIdPath}')">
														<font class="sub_menutext_font">${second.name }</font>
													</a>
												</p>
											</c:forEach>
											<p class="heighttxt">&nbsp;</p>
										</div>
									</c:if>
									<div class="sub_menu_right">
										<c:if test="${not empty item.displayPicConfigList }">
											<c:forEach var="config" items="${item.displayPicConfigList }">
												<img src="${fileServerBasePath }download/${config.fileId }">
											</c:forEach>
										</c:if>
									</div>
								</div></li>
			</c:when>
			<c:otherwise>
				<li style="width: 1085px;">
					<div class="sub_menu" kkkkkkkk="${(status.index+1) }">
						<p>
							<a href="javascript:void(0)" class="sub_menutitle"
								onclick="doSearch(this, 'categoryIdPath', '${item.fullIdPath}')">
								<font class="sub_menutitle_font">${item.name }</font>
							</a>
						</p>
						<c:if test="${not empty item.childCategoryList }">
							<div class="sub_menu_left">
								<c:forEach var="second" items="${item.childCategoryList }">
									<p>
										<a href="javascript:void(0)" class="sub_menutext"
											onclick="doSearch(this, 'categoryIdPath', '${second.fullIdPath}')">
											<font class="sub_menutext_font">${second.name }</font>
										</a>
									</p>
								</c:forEach>
								<p class="heighttxt">&nbsp;</p>
							</div>

						</c:if>
						<div class="sub_menu_right">
							<c:if test="${not empty item.displayPicConfigList }">
								<c:forEach var="config" items="${item.displayPicConfigList }">
									<img src="${fileServerBasePath }download/${config.fileId }">
								</c:forEach>
							</c:if>
						</div>
					</div>
			</c:otherwise>
			</c:choose>
			</c:forEach>
		</ul>
		</li>
		<!--品类一览    结束  -->

		<!--店铺   -->
		<li><a href="seller/shops" class="searchBarLi">SHOP<br />个&nbsp;人&nbsp;店&nbsp;铺
		</a>
			<ul>
				<li style="width: 1085px;">
				<div class="sub_menu" style="height: 350px;">
						<p>
							<a href="javascript:void(0)" class="sub_menutitle"><font class="sub_menutitleall">欧<font class="sub_shoptitle_font">· EUROPE ·</font>洲</font></a>
						</p>
						<div class="sub_menu_left">
						    <c:forEach var="location" items="${firstLevelLocationMap['EUROPE'].childLocationList }" begin="0" end="10">
						    <p>
							<a href="javascript:void(0)" onclick="doSearch(this, 'countryId', '${location.id}')" class="sub_menushop"><font class="sub_shoptext">${location.zhCn } <font
									class="sub_shoptext_font">${location.enUs }</font></font></a>
							</p>
						    </c:forEach>
							
						</div>
						<div class="shop_menu_right">
						     <c:forEach var="config" items="${firstLevelLocationMap['EUROPE'].displayPicConfigList }">
						        <div onclick="window.location.href='${config.path}';return false">
								<img src="${fileServerBasePath }download/${config.fileId }"/> <span>
									<font>${config.title }</font>
									<p>
										${config.comments }
									</p>
								</span>
							    </div>
						     </c:forEach>
							
						</div>
					</div>
					<div class="sub_menu" style="height: 125px;">
						<p>
							<a href="javascript:void(0)" class="sub_menutitle"><font class="sub_menutitleall">亚<font class="sub_shoptitle_font">· ASIA ·</font>洲</font></a>
						</p>
						<div style="float: left; width: 220px;">
						<c:forEach var="location" items="${firstLevelLocationMap['ASIA'].childLocationList }">
						    <p>
								<a href="javascript:void(0)" onclick="doSearch(this, 'countryId', '${location.id}')" class="sub_menushop">
									<font class="sub_shoptext">${location.zhCn } <font class="sub_shoptext_font">${location.enUs }</font></font></a>
							</p>
						</c:forEach>
						</div>
						<div class="shop_menu_right">
							 <c:forEach var="config" items="${firstLevelLocationMap['ASIA'].displayPicConfigList }">
						        <div onclick="window.location.href='${config.path}';return false">
								<img src="${fileServerBasePath }download/${config.fileId }"/> <span>
									<font>${config.title }</font>
									<p>
										${config.comments }
									</p>
								</span>
							    </div>
						     </c:forEach>
						</div>
					</div>
					<div class="sub_menu" style="height: 166px;">
						<p>
							<a href="javascript:void(0)" class="sub_menutitle"><font class="sub_menutitleall">美<font class="sub_shoptitle_font">· AMERICA ·</font>洲</font></a>
						</p>
						<div style="float: left; width: 220px;">
						<c:forEach var="location" items="${firstLevelLocationMap['AMERICA'].childLocationList }">
							<p>
								<a href="javascript:void(0)" onclick="doSearch(this, 'countryId', '${location.id}')" class="sub_menushop">
									<font class="sub_shoptext">${location.zhCn } <font class="sub_shoptext_font">${location.enUs }</font></font></a>
							</p>
						</c:forEach>
							
						</div>
						<div class="shop_menu_right">
							<c:forEach var="config" items="${firstLevelLocationMap['AMERICA'].displayPicConfigList }">
						        <div onclick="window.location.href='${config.path}';return false">
								<img src="${fileServerBasePath }download/${config.fileId }"/> <span>
									<font>${config.title }</font>
									<p>
										${config.comments }
									</p>
								</span>
							    </div>
						     </c:forEach>
						</div>
					</div></li>

			</ul></li>
		<!-- 店铺结束 -->
		<li><a href="seller/brands" class="searchBarLi">BRAND<br />品&nbsp;&nbsp;牌&nbsp;&nbsp;店&nbsp;&nbsp;铺
		</a></li>
		<li><a href="seller/inseller" class="searchBarLi">IN-SELLER<br />老&nbsp;&nbsp;外&nbsp;&nbsp;生&nbsp;&nbsp;活
		</a></li>
		<li><a href="javascript:void(0)" onclick="toPage(this, 'general/advice')" class="searchBarLi">COMMUNITY<br />&nbsp;社&nbsp;&nbsp;区&nbsp;&nbsp;交&nbsp;&nbsp;流
		</a></li>
		</ul>
		<div class="globalSearch right">
			<form id="_globalSearchForm" method="post" onsubmit="return beforeSubmit(this);">
				<input type="hidden" name="selectType" value="PRODUCT"/>
				<input id="globalSearchInput" type="text" class="font searchInput left en_SS" name="keyword" placeholder="SEARCH FOR SOMETHING" value="${keyword }"/>
				<ul class="searchSelect left">
				   <li style="display: inline-block;"><a href="javascript:void(0)" style="height: 25px;" onclick="$('.searchSelect-li').toggle()">
				   <img alt="" src="static/images/page/internalTestMessage/icon-tip.png" class="left" style="margin-top: -2px;"><p id="selectshow" class="left" value="PRODUCT">PRODUCT 商品</p></a></li>
				   <li class="searchSelect-li"><a class="selectstore" href="javascript:void(0)" onclick="selectchangetext()"><p id="selecthide" value="STORE">STORE 店铺</p></a></li>
				</ul>
				<input type="submit" class="font searchButton right fontColorWhite" value="SEARCH搜索" />
			</form>
		</div>
	</div>
</div>
<script type="text/javascript">
function selectchangetext(){
	var text=$("#selectshow").text();
	$("#selectshow").text($("#selecthide").text());
	$("#selecthide").text(text);
	$(".searchSelect-li").hide();
	var selectType = $("#selecthide").attr("value");
	$("INPUT[name='selectType']", "#_globalSearchForm").val(selectType);
}

function beforeSubmit(target){
	var keyword = $("INPUT[name='keyword']", target).val();
	if('' == $.trim(keyword)){
		return false;
	}
	var selectType = $("INPUT[name='selectType']", target).val();
	if("PRODUCT" == selectType){
		$(target).attr("action", "item/list");
	} else {
		$(target).attr("action", "seller/shops");
	}
}
function switchPage(pageNo){
	$("INPUT[name='pageIndex']", "#submitForm").val(pageNo);
	document.forms["submitForm"].submit();
}

function doSearch(target, inputName, inputValue){
	$("INPUT[name='"+inputName+"']", "#submitForm").val(inputValue);
	if("countryId" == inputName){
		$("INPUT[name='categoryIdPath']", "#submitForm").val("");
		$("#submitForm").attr("action", "seller/shops");
	} else {
		$("INPUT[name='countryId']", "#submitForm").val("");
		$("#submitForm").attr("action", "item/list");
	}
	switchPage(1);
}
</script>
<!-- navigation和全局搜索结束  -->